import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;


public class TestFrame {
	public static void main(String[] args){
	    JFrame f = new JFrame("This is a test");
	    Container content = f.getContentPane();
	    content.setBackground(Color.white);
	    content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
	
	    
	    f.setSize(new Dimension(400, 400));
	    
		BufferedImage medicine = new BufferedImage(1, 1, 1);
		try {
			medicine = ImageIO.read(new File("medicine.jpg"));
		} catch (IOException e) {
			e.printStackTrace();
		}
		JButton picMedicine = new JButton(new ImageIcon( medicine ));
		
		content.add(picMedicine);
		f.setVisible(true);
	    
	}
}

